package net.xdclass.valicate;

import net.xdclass.exception.JobException;
import net.xdclass.po.OrderItem;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.stereotype.Component;

@Component
public class TestDataValicate2ItemProcessor implements ItemProcessor<OrderItem, OrderItem> {
    @Override
    public OrderItem process(OrderItem item) throws Exception {
        // 返回null，会过滤掉这条数据
        if ("6".equals(item.getUserId())) {
            throw new JobException("任务处理出错");
        } else {
            return item;
        }
    }
}
